<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link type="text/css" href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" media="screen,projection,print"
	href="./css/layout3_setup.css" />
<link rel="stylesheet" type="text/css" media="screen,projection,print"
	href="./css/layout3_text.css" />

<title>Pruebas de bootstrap</title>
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"> </script>
	<script src="js/bootstrap.js"> </script>
	<script src="js/Popover.js"> </script>
	<script src="js/Tooltip.js"> </script>
	<script> 
	$(function(){
		$('#example').popover();
	});
	</script>
  <section >
      <div class="page-header">
        <h1>Popovers <small>bootstrap-popover.js</small></h1>
      </div>
      <div class="row">
        <div class="span9 columns">
          <div class="well">
            <a href="#" id="example" class="btn btn-primary" rel="popover" data-content="lo hice jejej jose lopez" data-original-title="Titulo de Alerta">salio</a>
          </div>
          <hr>
          <div class="alert alert-info">
            <strong>Heads up!</strong>
            Options for individual popovers can alternatively be specified through the use of data attributes.
          </div>
          </div>
      </div>
      
    </section>
    
    <div class="main-content">
	 <div class="column1-unit">
					<p>&nbsp;</p>

					<%@page import="modelo.Publicacion"%>
					<%@page import="negocio.GestionPublicacion"%>
					<%@page import="java.util.ArrayList"%>
					<%@page import="java.util.Iterator"%>
					<%
						GestionPublicacion negociopublicacion = new GestionPublicacion();
						ArrayList<Publicacion> listado = negociopublicacion.listarPublicacionesMasRecomendadas();
						Iterator y = listado.iterator();
						if (listado.size() > 0) {
							out.println("<div id=\"myCarousel\" class=\"carousel slide\">");
							out.println("<div class=\"carousel-inner\">");

							Publicacion publicacion = (Publicacion) y.next();
							out.println("<div class=\"item active\">");
							out.println("<table width=\"200\" border=\"1\">");
							out.println("<tr>");
							out.println("<th colspan=\"2\" scope=\"row\"><div align=\"center\"><h2>"
									+ publicacion.getTitulo() + "</h2></div></th>");
							out.println("</tr>");
							out.println("<tr>");
							out.println("<th scope=\"row\">Descripcion</th>");
							out.println("<td><div align=\"center\">"
									+ publicacion.getDescripcion() + "</div></td>");
							out.println("</tr>");
							out.println("<tr>");
							out.println("<th scope=\"row\">Estado</th>");
							out.println("<td><div align=\"center\">"
									+ publicacion.getEstado() + "</div></td>");
							out.println("</tr>");
							if (publicacion.getCantidad() != -1) {
								out.println("<tr>");
								out.println("<th scope=\"row\">Stock</th>");
								out.println("<td><div align=\"center\">"
										+ publicacion.getCantidad() + "</div></td>");
								out.println("</tr>");
							}
							out.println("<tr>");
							out.println("<th scope=\"row\">Precio</th>");
							out.println("<td><div align=\"center\">"
									+ publicacion.getPrecio() + "</div></td>");
							out.println("</tr>");
							out.println("<tr>");
							out.println("<th scope=\"row\">Creado</th>");
							out.println("<td><div align=\"center\">"
									+ publicacion.getFechaCreacion() + "</div></td>");
							out.println("</tr>");
							out.println("<tr>");
							out.println("<th scope=\"row\">Duracion</th>");
							out.println("<td><div align=\"center\">"
									+ publicacion.getDuracion()
									+ " d&iacute;as </div></td>");
							out.println("</tr>");
							out.println("<tr>");
							out.println("<th scope=\"row\">Categoria</th>");
							out.println("<td><div align=\"center\">"
									+ publicacion.getCategoria().getNombre()
									+ "</div></td>");
							out.println("</tr>");
							out.println("<tr>");
							out.println("<th scope=\"row\">Fotos</th>");
							out.println("<td><div align=\"center\">"
									+ publicacion.getFotos() + "</div></td>");
							out.println("</tr>");
							out.println("</table>");
							out.println("</div>");

							while (y.hasNext()) {
								publicacion = (Publicacion) y.next();
								out.println("<div class=\"item\">");
								out.println("<table width=\"200\" border=\"1\">");
								out.println("<tr>");
								out.println("<th colspan=\"2\" sscope=\"row\"><div align=\"center\"><h2>"
										+ publicacion.getTitulo() + "</h2></div></th>");
								out.println("</tr>");
								out.println("<tr>");
								out.println("<th scope=\"row\">Descripcion</th>");
								out.println("<td><div align=\"center\">"
										+ publicacion.getDescripcion() + "</div></td>");
								out.println("</tr>");
								out.println("<tr>");
								out.println("<th scope=\"row\">Estado</th>");
								out.println("<td><div align=\"center\">"
										+ publicacion.getEstado() + "</div></td>");
								out.println("</tr>");
								if (publicacion.getCantidad() != -1) {
									out.println("<tr>");
									out.println("<th scope=\"row\">Stock</th>");
									out.println("<td><div align=\"center\">"
											+ publicacion.getCantidad() + "</div></td>");
									out.println("</tr>");
								}
								out.println("<tr>");
								out.println("<th scope=\"row\">Precio</th>");
								out.println("<td><div align=\"center\">"
										+ publicacion.getPrecio() + "</div></td>");
								out.println("</tr>");
								out.println("<tr>");
								out.println("<th scope=\"row\">Creado</th>");
								out.println("<td><div align=\"center\">"
										+ publicacion.getFechaCreacion() + "</div></td>");
								out.println("</tr>");
								out.println("<tr>");
								out.println("<th scope=\"row\">Duracion</th>");
								out.println("<td><div align=\"center\">"
										+ publicacion.getDuracion()
										+ " d&iacute;as </div></td>");
								out.println("</tr>");
								out.println("<tr>");
								out.println("<th scope=\"row\">Categoria</th>");
								out.println("<td><div align=\"center\">"
										+ publicacion.getCategoria().getNombre()
										+ "</div></td>");
								out.println("</tr>");
								out.println("<tr>");
								out.println("<th scope=\"row\">Fotos</th>");
								out.println("<td><div align=\"center\">"
										+ publicacion.getFotos() + "</div></td>");
								out.println("</tr>");
								out.println("</table>");
								out.println("</div>");
							}

							out.println("</div>");
							out.println("<a class=\"left carousel-control\" href=\"#myCarousel\"");
							out.println("data-slide=\"prev\">&lsaquo;</a> <a class=\"right carousel-control\"");
							out.println("href=\"#myCarousel\" data-slide=\"next\">&rsaquo;</a>");
							out.println("</div>");
						}
					%>

					<p>&nbsp;</p>
					<p>&nbsp;</p>
   	<%@page import="modelo.Categoria"%>
					<%@page import="negocio.GestionCategoria"%>
					<%@page import="java.util.ArrayList"%>
					<%@page import="java.util.Iterator"%>
 <%
	GestionCategoria negocio = new GestionCategoria();
       ArrayList<Categoria> listado2= negocio.ListarCategorias_gestion();
   	Iterator w = listado2.iterator();
if (listado2.size() > 0 ){
out.println("<div id=\"myCarousel\" class=\"carousel slide\">");
out.println("<div class=\"carousel-inner\">");
Categoria categoria2 = (Categoria) w.next();
out.println("<table class=\"table table-bordered\">");
out.println("<thead>");
out.println("<tr>");
out.println("<th>Codigo</th>");
     out.println("<th>Nombre</th>");
     out.println("<th>Descripcion</th>");
    out.println("<th>Categoria(2)</th>");
 out.println("</tr>");
    out.println("</thead>");
     out.println("<tbody>");
        out.println("<tr>");
        out.println("<td>"+categoria2.getIdcategoria()+"</td>");
        out.println("<td>"+categoria2.getNombre()+"</td>");
        out.println("<td>"+categoria2.getDescripcion()+"</td>");
        out.println("<td>"+categoria2.getCategoria()+"</td>");
        out.println("</tr>");
         out.println("</tbody>");
 		 out.println("</table>");

		while (w.hasNext()){
    categoria2 = (Categoria) w.next();
	out.println("<table class=\"table table-bordered\">");
     out.println("<tbody>");
        out.println("<tr>");
        out.println("<td>"+categoria2.getIdcategoria()+"</td>");
        out.println("<td>"+categoria2.getNombre()+"</td>");
        out.println("<td>"+categoria2.getDescripcion()+"</td>");
        out.println("<td>"+categoria2.getCategoria()+"</td>");
        out.println("</tr>");
        out.println("</tbody>");
  out.println("</table>");
}
out.println("</div>");
//out.println("<a class=\"left carousel-control\" href=\"#myCarousel\"");
//out.println("data-slide=\"prev\">&lsaquo;</a> <a class=\"right carousel-control\"");
//out.println("href=\"#myCarousel\" data-slide=\"next\">&rsaquo;</a>");
out.println("</div>");  
}
%>  
				</div>
		 </div>
	
</body>
</html>